package org.nobject.common.db.member;

import java.util.HashMap;
import java.util.Map;

/**
 * SqlWhereRule
 *
 * @author bianrongjun
 * @version 1.0
 */
public class SqlWhereRule {
	
	/** rules */
	private Map<String,SqlWhereRuleEle> ruleElesMap=new HashMap();;
	
	/** 构造函数  */
	public SqlWhereRule(SqlWhereRuleEle... ruleEles){
		for(SqlWhereRuleEle ruleEle:ruleEles) ruleElesMap.put(ruleEle.column, ruleEle);
	}
	
	/** 是否有该字段 */
	public boolean has(String column){return ruleElesMap.containsKey(column);}
	/** 获取RuleEle */
	public SqlWhereRuleEle getRuleEle(String column){return ruleElesMap.get(column);}
	/** 获取比较符 */
	public String getCmp(String column){return getRuleEle(column).cmp;}
	/** 获取关系 */
	public String getRelate(String column){return getRuleEle(column).relate;}
	/** 获取类型 */
	public String getType(String column){return getRuleEle(column).type;}
}